package main
import "fmt"

var a1 = 100
var a2 = 200
var a3 = "AJun"
//上面的声明方式，也可以改成一次性声明
var (
	b1 = 458392587394
	b2 = "AJun"
	b3 = 534953.54353
	b4 = -4534535
)

func main() {
	//该案例演示golang如何一次性声明多个变量
	var n1, n2, n3 int
	fmt.Println("n1 =", n1, "n2 =", n2, "n3 =", n3)

	//一次性声明多个变量的方式2
	var n4, name, n5 = 100, "AJun", 3.1415926
	fmt.Println("n4 =", n4, "name =", name, "n5 =", n5)

	//一次性声明多个变量的方式3，同样可以使用类型推导
	n6, n7, n8 := 89483298439473853, "CZY", "LOVE"
	fmt.Println("n6 =", n6, "n7 =", n7, "n8 =", n8)

	//输出全局变量
	fmt.Println("a1 =", a1, "a2 =", a2, "a3 =", a3)
	fmt.Println("b1 =", b1, "b2 =", b2, "b3 =", b3, "b4 =", b4)
}